import { ref } from "vue"
import { getBannerData } from "@/apis/home"

export const useBanner = () => {
  // 保存轮播图数据
  const bannerList = ref([])
  // 获取轮播图数据
  const getBanner = async () => {
    const res = await getBannerData(2)
    bannerList.value = res.data.result
  }

  getBanner()

  return {
    bannerList,
  }
}
